﻿#region Using References

using System;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using Beaker.OpenCube.Game;
using Beaker.OpenCube.Textures;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

#endregion

namespace Beaker.OpenCube.Specs.Textures
{
	[ExcludeFromCodeCoverage]
	[TestClass]
	public class BlockTextureSpecs
	{
		[TestMethod]
		public void MultipleFlagsWillBeFlattend()
		{
			// arrange
			var image = new Bitmap( 16,16  );
			var texture = new Texture( image );
			var textures = new[]
			{
				Tuple.Create( BlockTextureFlags.Top | BlockTextureFlags.Bottom, texture )
			};

			// act
			var blockTexture = new BlockTexture( Block.Dirt, textures );

			// assert
			blockTexture.Textures[BlockTextureFlags.Top].Should().Be( texture );
			blockTexture.Textures[BlockTextureFlags.Bottom].Should().Be( texture );
		}

		[TestMethod]
		public void SetBlockIsReturned()
		{
			// arrange
			var image = new Bitmap( 16, 16 );
			var texture = new Texture( image );
			var textures = new[]
			{
				Tuple.Create( BlockTextureFlags.Top | BlockTextureFlags.Bottom, texture )
			};

			// act
			var blockTexture = new BlockTexture( Block.Dirt, textures );

			// assert
			blockTexture.Block.Should().Be( Block.Dirt );
		}
	}
}
